Optimal. Leaf size=63 \[ -\frac{2 a^3 \tan (c+d x)}{d}-\frac{4 i a^3 \log (\cos (c+d x))}{d}+4 a^3 x+\frac{i a (a+i a \tan (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0317299, antiderivative size = 63, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3478, 3477, 3475} \[ -\frac{2 a^3 \tan (c+d x)}{d}-\frac{4 i a^3 \log (\cos (c+d x))}{d}+4 a^3 x+\frac{i a (a+i a \tan (c+d x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3478
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int (a+i a \tan (c+d x))^3 \, dx &=\frac{i a (a+i a \tan (c+d x))^2}{2 d}+(2 a) \int (a+i a \tan (c+d x))^2 \, dx\\ &=4 a^3 x-\frac{2 a^3 \tan (c+d x)}{d}+\frac{i a (a+i a \tan (c+d x))^2}{2 d}+\left (4 i a^3\right ) \int \tan (c+d x) \, dx\\ &=4 a^3 x-\frac{4 i a^3 \log (\cos (c+d x))}{d}-\frac{2 a^3 \tan (c+d x)}{d}+\frac{i a (a+i a \tan (c+d x))^2}{2 d}\\ \end{align*}
Mathematica [A] time = 0.784299, size = 119, normalized size = 1.89 \[ \frac{a^3 \sec (c) \sec ^2(c+d x) \left (-3 \sin (c+2 d x)+2 d x \cos (3 c+2 d x)-i \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )+\cos (c+2 d x) \left (2 d x-i \log \left (\cos ^2(c+d x)\right )\right )+\cos (c) \left (-2 i \log \left (\cos ^2(c+d x)\right )+4 d x-i\right )+3 \sin (c)\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 68, normalized size = 1.1 \begin{align*} -3\,{\frac{{a}^{3}\tan \left ( dx+c \right ) }{d}}-{\frac{{\frac{i}{2}}{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{2\,i{a}^{3}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{d}}+4\,{\frac{{a}^{3}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.66684, size = 103, normalized size = 1.63 \begin{align*} a^{3} x + \frac{3 \,{\left (d x + c - \tan \left (d x + c\right )\right )} a^{3}}{d} + \frac{i \, a^{3}{\left (\frac{1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} + \frac{3 i \, a^{3} \log \left (\sec \left (d x + c\right )\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.23346, size = 267, normalized size = 4.24 \begin{align*} \frac{-8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - 6 i \, a^{3} +{\left (-4 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.35666, size = 100, normalized size = 1.59 \begin{align*} - \frac{4 i a^{3} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac{- \frac{8 i a^{3} e^{- 2 i c} e^{2 i d x}}{d} - \frac{6 i a^{3} e^{- 4 i c}}{d}}{e^{4 i d x} + 2 e^{- 2 i c} e^{2 i d x} + e^{- 4 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.11637, size = 158, normalized size = 2.51 \begin{align*} \frac{-4 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 6 i \, a^{3}}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]